package com.plm.maque.controller;

import com.plm.maque.service.DownloadService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Limi
 * @create 2020-07-19 23:39
 */
@Api(tags = "文件下载")
@RestController
@RequestMapping("/download")
public class DownloadController {

    @Value("${apk.path}")
    private String path;

    private final DownloadService downloadService;

    public DownloadController(DownloadService downloadService) {
        this.downloadService = downloadService;
    }

    @ApiOperation(value = "下载麻雀商城App")
    @GetMapping("/androidApp")
    public void getAndroidApp(){
        downloadService.download(path);
    }

}
